package com.myframe.www.recycle;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.myframe.www.R;
import com.myframe.www.base.BaseActivity;
import com.myframe.www.recycle.adapter.RecycleAdapter;

import butterknife.Bind;

public class RecycleAgainActivity extends BaseActivity {

    @Bind(R.id.recycle_again)
    RecyclerView mRecycleAgain;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initdata();
    }

    @SuppressLint("ResourceType")
    private void initdata() {
//        mRecycleAgain.setLayoutManager(new LinearLayoutManager(this));
        mRecycleAgain.setLayoutManager(new GridLayoutManager(this,4));
        mRecycleAgain.setAdapter(new RecycleAdapter(this));
//        mRecycleAgain.addItemDecoration(new DivderItemDecoration(this,DivderItemDecoration.VERTICAL_LIST));
        mRecycleAgain.addItemDecoration(new GridItemDecoration.Builder(this).size(12).color(R.color.white).margin(12,12).isExistHead(false).build());

    }

    @Override
    protected void initToolbar() {
        hideToolbar();
    }

    @Override
    protected int getContentViewLayoutId() {
        return R.layout.activity_recycle_again;
    }

    @Override
    protected void onViewCreated(Bundle savedInstanceState) {

    }

    public static void start(Activity activity) {
        Intent intent = new Intent(activity, RecycleAgainActivity.class);
        activity.startActivity(intent);
    }


}
